<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    var arr = [1,2,4,5];
    // var arr2 = arr;
    // arr2.push(6);
    // console.log(arr)
    /* var arr2 = [...arr];
    arr2.push(6)
    console.log(arr)
    var obj = {
      a:10,
      b:20
    }
    var obj2 = {
      ...obj
    }
    obj2.a = 100
    console.log(obj2)
    console.log(obj) 
    var arr3 = [1,2,2,1,3,5,4,3,5,6]
    var newArr = [...new Set(arr3)]
    console.log(newArr) */

    // Object.assign 合并对象
    var obj= {
      a:10,
      b:20
    }
    var obj2= {
      c:30,
      d:100
    }
    // var obj3 = Object.assign(obj,obj2)
    var obj3 = {
      ...obj,
      ...obj2
    }
    console.log(obj3)
  </script>
</body>
</html>